| 217 | |
| 218 | |
| 219 | class CodeCacheArray { |
| 220 | private: |
| 221 | CodeCache* _libs[MAX_NATIVE_LIBS]; |
| 222 | int _count; |
| 223 | size_t _used_memory; |
| 224 | |
| 225 | public: |
| 226 | CodeCacheArray() : _count(0) { |
| 227 | } |
| 228 | |
| 229 | CodeCache* operator[](int index) { |
| 230 | return _libs[index]; |
| 231 | } |
| 232 | |
| 233 | int count() { |
| 234 | return loadAcquire(_count); |
| 235 | } |
| 236 | |
| 237 | size_t usedMemory() { |
| 238 | return _used_memory; |
| 239 | } |
| 240 | |
| 241 | void add(CodeCache* lib) { |
| 242 | int index = loadAcquire(_count); |
| 243 | _libs[index] = lib; |
| 244 | _used_memory += lib->usedMemory(); |
| 245 | storeRelease(_count, index + 1); |
| 246 | } |
| 247 | }; |
| 248 | |
| 249 | #endif // _CODECACHE_H |
nothing calls this directly
no outgoing calls
no test coverage detected