The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / src / smalloc.cc @ 6f92da2d

History | View | Annotate | Download (11.3 KB)

# Date Author Comment
78d90945 08/02/2013 05:16 PM Ben Noordhuis

src: remove non-isolate PersistentToLocal()

There is no need for it and it's a tiny bit slower than the version of
PersistentToLocal() that takes a v8::Isolate* as its first argument.

2dafa193 08/02/2013 04:00 PM Trevor Norris

smalloc: remove double checks

Now that values are checks in JS, no need for them to be checked in C++.

02cab974 07/31/2013 05:16 PM Ben Noordhuis

src: more lint after cpplint tightening

Commit 847c6d9 adds a 'project headers before system headers' check
to cpplint. Update the files in src/ to make the linter pass again.

c76ed643 07/24/2013 12:17 PM Trevor Norris

smalloc: add external to alloc with callbacks

Forgot to actually assign cb_info to the External in smalloc::Alloc()
that accepts a callback to be run in the weak callback.

35e0d60d 07/22/2013 08:27 PM Trevor Norris

buffer: slice on zero length buffer

SlowBuffer(0) passes NULL instead of doing malloc(0). So when someone
attempted to SlowBuffer(0).slice(0, 1) an assert would fail in
smalloc::SliceOnto.

It's important that the check go where it is because the resulting...

d817843d 07/19/2013 04:36 PM Trevor Norris

smalloc: create separate module

It will be confusing if later on we add Buffer#dispose(), and smalloc is
its own cpp api anyways. So instead create a new require('smalloc') to
expose the previous Buffer.alloc/dispose methods, and expose copyOnto
and kMaxLength as well....

be940b45 07/15/2013 02:08 PM Trevor Norris

smalloc: remove NULL assert check

In fa10b75 the assert to check if data NULL was remove for
smalloc::Alloc with no callback. It should have also been removed where
a callback is accepted.

No sense in making sure that length 0 if data == NULL because devs...

ead8e26b 07/08/2013 02:09 PM Trevor Norris

smalloc: call callback if set on AllocDispose

Fix bug where if dev passed a callback to Alloc then called AllocDispose
it wouldn't bother to pass the data to the callback and instead would
just free it.

aa8c4a07 07/08/2013 12:17 PM Trevor Norris

smalloc: zero size allocs may need to be free'd

Zero size allocations don't necessarily mean that data == NULL. So
instead check each value seperately and perform necessary operations.

636ca7c6 07/07/2013 08:24 AM Ben Noordhuis

src: cast strong persistent handles to locals

Avoids the overhead of creating a new Local every time we unwrap a
Persistent handle.

3220bc42 07/07/2013 07:30 AM Ben Noordhuis

smalloc: don't take address of stack var

eec43351 07/06/2013 06:05 PM Trevor Norris

smalloc: revert change to use pointer indirection

Better to compare fixed addresses than to use pointer indirection.

110a9cd8 07/06/2013 11:44 AM Ben Noordhuis

lib, src: upgrade after v8 api change

This is a big commit that touches just about every file in the src/
directory. The V8 API has changed in significant ways. The most
important changes are:

  • Binding functions take a const v8::FunctionCallbackInfo<T>& argument...
28609d17 07/05/2013 07:52 PM Fedor Indutny

smalloc: fix style, use macro

fa10b757 07/03/2013 06:03 PM Trevor Norris

smalloc: use malloc instead of new

To use realloc the implementation had to be changed to use malloc/free.

252cdfa4 06/18/2013 06:38 PM Trevor Norris

smalloc: add api to manually dispose Persistent

If the user knows the allocation is no longer needed then the memory can
be manually released.

Currently this will not ClearWeak the Persistent, so the callback will
still run.

If the user passed a ClearWeak callback, and then disposed the object,...

8f3f9f78 06/18/2013 06:37 PM Trevor Norris

smalloc: initial implementation

smalloc is a simple utility for quickly allocating external memory onto
js objects. This will be used to centralize how memory is managed in
node, and will become the backer for Buffers. So in the future crypto's
SlabBuffer, stream's SlabAllocator will be removed....