I don't have understood this part, let me explain it to you. This is how i get it tell me if i'm wrong at any part.
I need to understand how is the structure in memory of the arraybuffer how is it represented and if the data of the array are directly stored at an offset accessed by buffer_ -> data(). before the call to expand capacity it does create an array the arraybuffer in src <https://cs.chromium.org/chromium/src/>/third_party <https://cs.chromium.org/chromium/src/third_party/>/blink <https://cs.chromium.org/chromium/src/third_party/blink/>/renderer <https://cs.chromium.org/chromium/src/third_party/blink/renderer/>/platform <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/>/ wtf <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/> /typed_arrays <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/> /array_buffer_builder.cc <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc> is called whenever the renderer (has to execute some javascript which defines arraybuffers) First when is arraybuffer::append called, cause i know that if someone need to reallocate a bigger arraybuffer then a new instance will be created and filled with the old values if the length in the original array isn't has much as the user reqeusted ? One more thing is, when this class is called, the arraybuffer is always set to the initial length of static const int kDefaultBufferCapacity <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc?l=38&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fthird_party%252Fblink%252Frenderer%252Fplatform%252Fwtf%252Ftyped_arrays%252Farray_buffer_builder.cc%2523YXDT7WTpXCAcuhdyTlkuCzsfCzI%25252BoHLRFAlkbCrkx4g%25253D&gsn=kDefaultBufferCapacity&ct=xref_usages> = 32768; if in the javascript i declare an arraybuffer of 20bytes will it allocate of 32768bytes anyway =? Il giorno mar 4 set 2018 alle ore 12:14 Graham Reeves < gra...@grahamreeves.com> ha scritto: > > is std::numeric_limits > <https://cs.chromium.org/chromium/src/buildtools/third_party/libc%2B%2B/trunk/include/limits?l=442&ct=xref_jump_to_def&gsn=numeric_limits> > <unsigned>::max > <https://cs.chromium.org/chromium/src/buildtools/third_party/libc%2B%2B/trunk/include/limits?l=450&ct=xref_jump_to_def&gsn=max>(); > referring to the max unsigned int value ? cause the source code won't find > it > Yes, that's the maximum value unsigned (an unsigned int) can be, but what > do you mean by, the source won't find it? > > On Monday, 3 September 2018 19:55:48 UTC+1, dan Med wrote: >> >> Can someone help me out? >> >> Il giorno sab 1 set 2018 alle ore 15:30 <litoki...@gmail.com> ha scritto: >> >>> array_buffer_builder.cc in src <https://cs.chromium.org/chromium/src/>/ >>> third_party <https://cs.chromium.org/chromium/src/third_party/>/blink >>> <https://cs.chromium.org/chromium/src/third_party/blink/>/renderer >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/>/ >>> platform >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/> >>> /wtf >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/> >>> /typed_arrays >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/> >>> /array_buffer_builder.cc >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc> >>> >>> the ArrayBufferBuilder >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=44&ct=xref_jump_to_def&gsn=ArrayBufferBuilder> >>> ::Append >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc?l=74&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fthird_party%252Fblink%252Frenderer%252Fplatform%252Fwtf%252Ftyped_arrays%252Farray_buffer_builder.cc%2523NFGzJegTouRzc7WYe5NO52sD3rtLZRfs3mHeMLIQn8I%25253D&gsn=Append&ct=xref_usages> >>> method >>> will be called through a view on top of the arraybuffer? something like, >>> there's a arraybuffer of 30bytes in length and we define a view on top of >>> it (so a typedarray) wehn i call on the new typedarray object the .append >>> method it will call ArrayBufferBuilder >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=44&ct=xref_jump_to_def&gsn=ArrayBufferBuilder> >>> ::Append >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc?l=74&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fthird_party%252Fblink%252Frenderer%252Fplatform%252Fwtf%252Ftyped_arrays%252Farray_buffer_builder.cc%2523NFGzJegTouRzc7WYe5NO52sD3rtLZRfs3mHeMLIQn8I%25253D&gsn=Append&ct=xref_usages> >>> and then inside it's code it will execute ArrayBufferBuilder >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=44&ct=xref_jump_to_def&gsn=ArrayBufferBuilder> >>> ::ExpandCapacity >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc?l=45&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fthird_party%252Fblink%252Frenderer%252Fplatform%252Fwtf%252Ftyped_arrays%252Farray_buffer_builder.cc%2523Fu6GnwJLuMqh5Thz%25252BDq0LStBEA8HzkICqnAPtIOPIhY%25253D&gsn=ExpandCapacity&ct=xref_usages> >>> if >>> it needs to reallocate the array ? >>> >>> if so inside the expandCapacity definition bytes_used >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=92&ct=xref_jump_to_def&gsn=bytes_used_> >>> referes >>> to the elements inside the actual arraybuffer so if i have a arraybuffer >>> which is 8 bytes in length [ ][ ][ ][ ][ ][ ][ ][ ] and i fill in only 3 >>> bytes so >>> [1][2][3][ ][ ][ ][ ][ ] the bytes_used >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=92&ct=xref_jump_to_def&gsn=bytes_used_> >>> when >>> retrieved will be set to 3 bytes ?? >>> >>> ArrayBufferBuilder >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=44&ct=xref_jump_to_def&gsn=ArrayBufferBuilder>::ArrayBufferBuilder >>> >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc?l=40&gs=kythe%253A%252F%252Fchromium%253Flang%253Dc%25252B%25252B%253Fpath%253Dsrc%252Fthird_party%252Fblink%252Frenderer%252Fplatform%252Fwtf%252Ftyped_arrays%252Farray_buffer_builder.cc%2523lcp23D0sHKN2WnDoJe7UbBQtgQbZY3lJ%25252Bn9qnDlawck%25253D&gsn=ArrayBufferBuilder&ct=xref_usages>() >>> : bytes_used_ >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=92&ct=xref_jump_to_def&gsn=bytes_used_>(0), >>> variable_capacity_ >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=93&ct=xref_jump_to_def&gsn=variable_capacity_>(true) >>> { buffer_ >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.h?l=94&ct=xref_jump_to_def&gsn=buffer_> >>> = >>> <https://cs.chromium.org/chromium/src/base/memory/scoped_refptr.h?l=226&ct=xref_jump_to_def&gsn=%3D> >>> ArrayBuffer >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer.h?l=42&ct=xref_jump_to_def&gsn=ArrayBuffer>::Create >>> >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer.h?l=125&ct=xref_jump_to_def&gsn=Create>(kDefaultBufferCapacity >>> >>> <https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_builder.cc?l=38&ct=xref_jump_to_def&gsn=kDefaultBufferCapacity>, >>> 1);} >>> here buffer_ will be equal to an arraybuffer of 32768 bytes in length ? >>> since the KdefaultBuffer... is set to that value. >>> is std::numeric_limits >>> <https://cs.chromium.org/chromium/src/buildtools/third_party/libc%2B%2B/trunk/include/limits?l=442&ct=xref_jump_to_def&gsn=numeric_limits><unsigned>::max >>> >>> <https://cs.chromium.org/chromium/src/buildtools/third_party/libc%2B%2B/trunk/include/limits?l=450&ct=xref_jump_to_def&gsn=max>(); >>> referring to the max unsigned int value ? cause the source code won't find >>> it >>> >>> -- >>> -- >>> v8-users mailing list >>> v8-u...@googlegroups.com >>> http://groups.google.com/group/v8-users >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "v8-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to v8-users+u...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > -- > v8-users mailing list > v8-users@googlegroups.com > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.