Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
smalloc: deprecate whole module
It makes no sense to allow people use constants from
`smalloc`, since it will be removed completely eventually.
  • Loading branch information
vkurchatkin committed May 29, 2015
commit 475795bef515b96629e8cc4bc679b707ab264fd8
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Readable = Stream.Readable;
const Writable = Stream.Writable;

const kMinPoolSpace = 128;
const kMaxLength = require('smalloc').kMaxLength;
const kMaxLength = require('internal/smalloc').kMaxLength;

const O_APPEND = constants.O_APPEND || 0;
const O_CREAT = constants.O_CREAT || 0;
Expand Down
3 changes: 1 addition & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ exports.writer = util.inspect;
exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster',
'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net',
'os', 'path', 'punycode', 'querystring', 'readline', 'stream',
'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib',
'smalloc'];
'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];


const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' +
Expand Down
27 changes: 3 additions & 24 deletions lib/smalloc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
'use strict';

const smalloc = require('internal/smalloc');
const deprecate = require('util').deprecate;
const util = require('internal/util');

exports.alloc =
deprecate(smalloc.alloc, 'smalloc.alloc: Deprecated, use typed arrays');

exports.copyOnto =
deprecate(smalloc.copyOnto,
'smalloc.copyOnto: Deprecated, use typed arrays');

exports.dispose =
deprecate(smalloc.dispose,
'smalloc.dispose: Deprecated, use typed arrays');

exports.hasExternalData =
deprecate(smalloc.hasExternalData,
'smalloc.hasExternalData: Deprecated, use typed arrays');

Object.defineProperty(exports, 'kMaxLength', {
enumerable: true, value: smalloc.kMaxLength, writable: false
});

Object.defineProperty(exports, 'Types', {
enumerable: true, value: Object.freeze(smalloc.Types), writable: false
});
module.exports = require('internal/smalloc');
util.printDeprecationMessage('smalloc is deprecated.');