Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Side by Side Diff: include/v8.h

Issue 21818003: Revert "Add size_t length argument to v8::ArrayBuffer::Allocator::Free." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after
2418 * Allocate |length| bytes. Return NULL if allocation is not successful. 2418 * Allocate |length| bytes. Return NULL if allocation is not successful.
2419 * Memory does not have to be initialized. 2419 * Memory does not have to be initialized.
2420 */ 2420 */
2421 virtual void* AllocateUninitialized(size_t length) { 2421 virtual void* AllocateUninitialized(size_t length) {
2422 // Override with call to |Allocate| for compatibility 2422 // Override with call to |Allocate| for compatibility
2423 // with legacy version. 2423 // with legacy version.
2424 return Allocate(length); 2424 return Allocate(length);
2425 } 2425 }
2426 2426
2427 /** 2427 /**
2428 * Free the memory block of size |length|, pointed to by |data|. 2428 * Free the memory pointed to |data|. That memory is guaranteed to be
2429 * That memory is guaranteed to be previously allocated by |Allocate|. 2429 * previously allocated by |Allocate|.
2430 */ 2430 */
2431 virtual void Free(void* data, size_t length) { 2431 virtual void Free(void* data) = 0;
2432 // Override with call to |Free(void*)| for compatibility
2433 // with legacy version.
2434 Free(data);
2435 }
2436
2437 /**
2438 * Deprecated. Never called directly by V8.
2439 * For compatibility with legacy version of this interface.
2440 */
2441 virtual void Free(void* data);
2442 }; 2432 };
2443 2433
2444 /** 2434 /**
2445 * The contents of an |ArrayBuffer|. Externalization of |ArrayBuffer| 2435 * The contents of an |ArrayBuffer|. Externalization of |ArrayBuffer|
2446 * returns an instance of this class, populated, with a pointer to data 2436 * returns an instance of this class, populated, with a pointer to data
2447 * and byte length. 2437 * and byte length.
2448 * 2438 *
2449 * The Data pointer of ArrayBuffer::Contents is always allocated with 2439 * The Data pointer of ArrayBuffer::Contents is always allocated with
2450 * Allocator::Allocate that is set with V8::SetArrayBufferAllocator. 2440 * Allocator::Allocate that is set with V8::SetArrayBufferAllocator.
2451 * 2441 *
(...skipping 4085 matching lines...) Expand 10 before | Expand all | Expand 10 after
6537 6527
6538 6528
6539 } // namespace v8 6529 } // namespace v8
6540 6530
6541 6531
6542 #undef V8EXPORT 6532 #undef V8EXPORT
6543 #undef TYPE_CHECK 6533 #undef TYPE_CHECK
6544 6534
6545 6535
6546 #endif // V8_H_ 6536 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698