| // Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| Java_org_chromium_memconsumer_ResidentService_nativeUseMemory(JNIEnv* env, |
| m_z = 36969 * (m_z & 65535) + (m_z >> 16); |
| m_w = 18000 * (m_w & 65535) + (m_w >> 16); |
| return (m_z << 16) + m_w; |
| Java_org_chromium_memconsumer_ResidentService_nativeUseMemory( |
| static uint32_t* g_memory = NULL; |
| g_memory = static_cast<uint32_t*>(malloc(memory)); |
| __android_log_print(ANDROID_LOG_WARN, |
| "Unable to allocate %ld bytes", |
| // If memory allocation failed, try to allocate as much as possible. |
| g_memory = static_cast<uint32_t*>(malloc(memory)); |
| for (int i = 0; i < memory / sizeof(uint32_t); ++i) |
| *(g_memory + i) = get_random(); |