Changeset 36863 in webkit for trunk/JavaScriptCore/API


Ignore:
Timestamp:
Sep 24, 2008, 1:38:55 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-24 Geoffrey Garen <[email protected]>

Reviewed by Darin Adler.


Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
the objects it retains

  • API/JSBase.h: Filled in some missing function names.
  • API/tests/testapi.c: Test the new SPI a little.
  • API/JSSPI.cpp: Add the new SPI.
  • API/JSSPI.h: Add the new SPI.
  • JavaScriptCore.exp: Add the new SPI.
  • JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
Location:
trunk/JavaScriptCore/API
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSBase.cpp

    r36263 r36863  
    2626#include "config.h"
    2727#include "JSBase.h"
     28#include "JSBasePrivate.h"
    2829
    2930#include "APICast.h"
     
    103104    // the collector is busy.
    104105}
     106
     107void JSReportExtraMemoryCost(JSContextRef ctx, size_t size)
     108{
     109    ExecState* exec = toJS(ctx);
     110    exec->globalData().heap->registerThread();
     111    JSLock lock(exec);
     112
     113    exec->globalData().heap->reportExtraMemoryCost(size);
     114}
  • trunk/JavaScriptCore/API/tests/testapi.c

    r36784 r36863  
    2525
    2626#include "JavaScriptCore.h"
     27#include "JSBasePrivate.h"
    2728#include <math.h>
    2829#include <wtf/Assertions.h>
     
    584585    JSGlobalContextRetain(context);
    585586    JSGlobalContextRelease(context);
     587   
     588    JSReportExtraMemoryCost(context, 0);
     589    JSReportExtraMemoryCost(context, 1);
     590    JSReportExtraMemoryCost(context, 1024);
    586591
    587592    JSObjectRef globalObject = JSContextGetGlobalObject(context);
Note: See TracChangeset for help on using the changeset viewer.